<?php

// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

use think\Route;

// 默认路径  http://localhost/api/...
// 如：http://localhost/api/login  微信小程序登录接口
// ⚠️注意：如果有多端，则需要在Api的基础上加入相应的分组(group)  如手机端 mobile，网页 h5等

Route::group('', function () {
    Route::group('api', function () {
        Route::post('login', 'api/Login/wxMiniProgramLogin'); // 微信小程序登录
        Route::get('login_gzh', 'api/Login/wxOfficialAccountLogin'); // 微信公众号登录
        Route::any('oauth_callback', 'api/Login/oauthCallback'); // 微信公众号登录回调
        Route::get('is_read', 'api/Index/is_read'); // 轮询提醒

        // 支付相关接口
        Route::group('pay', function () {
            Route::post('', 'api/Pay/pay'); // 微信支付 统一下单
            Route::any('response', 'api/Pay/response'); // 微信支付回调
        });

        Route::group('user', function () { //我的
            Route::get('/', 'api/User/getUserInfo'); //个人信息
            Route::get('get_notice', 'api/User/getNotice'); //平台公告
            Route::get('get_notice_details', 'api/User/getNoticeDetails'); //平台公告详情
            Route::get('get_about', 'api/User/getAbout'); //关于我们
        });

        Route::group('product', function () {
            Route::get('/', 'api/Index/getProduct'); //首页商品列表
            Route::get('details/:id', 'api/Index/productDetails'); //商品详情
            Route::get('vessel_type', 'api/Index/getVesselType'); //船只类型标签
            Route::get('get_product/:id', 'api/Index/getProductById'); //船源列表
        });

        Route::group('order', function () {
            Route::get('qr_code', 'api/Order/qrCode'); //二维码
            Route::get('/', 'api/Order/orderList');//订单列表
            Route::post('tickets', 'api/Order/tickets'); //购票
            Route::post('cancellation', 'api/Order/cancellation'); //扫码核销
            Route::post('apply', 'api/Order/apply'); //按人数核销
            Route::post('deposit_refund', 'api/Order/deposit'); //申请取消订单
            Route::get('order_details', 'api/Order/orderDetails'); //订单详情
            Route::post('order_reserve', 'api/Order/reserve'); // yunzhihui 修改订单预约时间
        });

        Route::group('cancel', function () {
            Route::get('/', 'api/Cancel/cancelList'); //核销记录
            Route::get('cancel_details', 'api/Cancel/cancelDetailsList'); //核销记录详情
        });

        Route::group('device', function () {
            Route::get('qr_code/update','api/Device/qrCodeUpdate'); // 更新核销二维码
            Route::any('qr_code/callback','api/Device/qrCodeCallback'); // 扫码器传递参数核销
        });

        Route::group('system', function () {
            Route::get('config', 'api/System/config'); // yunzhihui 获取系统配置-下单启用当天预约等
        });
        

    });
});

